package com.mfin.bs.services;

import com.mfin.bs.mgr.impl.TransactionManager;
import com.mfin.bs.mgr.interfaces.ITransactionManager;
import com.mfin.bs.mgr.interfaces.IUserProfileManager;
import com.mfin.vo.UserVO;
import com.mfin.vo.finance.FinanceVO;

public class UserProfileServicesImpl extends BaseImpl implements
		IUserProfileServices {

	@Override
	public UserVO validateUser(UserVO userVO) {
		ITransactionManager transaction = new TransactionManager();
		transaction.beginTransaction();

		IUserProfileManager userProfileManager = getUserProfileManager(transaction
				.getPersistenceGovernor());
		UserVO validatedUserVO = userProfileManager
				.validateUser(userVO);

		transaction.commitTransaction();
		return validatedUserVO;
	}

	@Override
	public FinanceVO getUserFinance(UserVO userVO) {
		ITransactionManager transaction = new TransactionManager();
		transaction.beginTransaction();

		IUserProfileManager userProfileManager = getUserProfileManager(transaction
				.getPersistenceGovernor());
		FinanceVO financeVO = userProfileManager.getUserFinance(userVO);

		transaction.commitTransaction();
		return financeVO;
	}

}
